//
//  Tool.h
//  HelpThePoor
//
//  Created by van7ish on 2016/11/26.
//  Copyright © 2016年 van7ish. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ifaddrs.h>
#import <arpa/inet.h>
#import <net/if.h>

#define IOS_CELLULAR    @"pdp_ip0"
#define IOS_WIFI        @"en0"
#define IOS_VPN         @"utun0"
#define IP_ADDR_IPv4    @"ipv4"
#define IP_ADDR_IPv6    @"ipv6"

@interface Tool : NSObject

/** 设置视图控制器导航条为透明色 */
+ (void)setNavigationBarType:(UIViewController *)viewController;
/** 判断手机号 */
+ (BOOL)isMobileNumber:(NSString *)mobileNum;
/** 获取电池电量 */
+ (CGFloat)getBatteryQuantity;
/** 时间戳转换 */
+ (NSString *)dateConvert:(NSString *)time;
/** 获取当前登录设备ip地址 */
+ (NSString *)getIPAddress:(BOOL)preferIPv4;
/** 获取设备外网地址 */
+ (NSString *)getIPAddressWAN;
/** 判断身份证号是否合法 */
+ (BOOL)isValidateIDNumber:(NSString *)idNumber;

//设置
+ (void)setValueForKey:(id)value key:(NSString *)key;
+(id) getValueFromKey:(NSString *)keyInDefaults;
+(void)removeKeyValue:(NSString*)key;

@end
